<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定位-居中</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .fa {
            width: 1000px;
            height: 500px;
            /* background: skyblue; */
            border: 3px solid red;
            /* transform: translate(50%,50%); */
        }
        .son {
            width: 500px;
            height: 300px;
            background: pink;
            transform: translate(50%,50%);
        }
    </style>
</head>
<body>
    <div class="fa">
        <div class="son">儿子</div>
    </div>
</body>
</html>